package yf.mall.entity;


import lombok.Setter;
import lombok.Getter;

import java.io.Serializable;
import java.util.Date;

import java.math.BigDecimal;

/**
 * 课程卡券实体
 * 表名 course_card
 *
 * @author hxf
 * @email 505860922@qq.com
 * @date Mon Oct 21 10:16:15 CST 2019
 */
@Setter
@Getter
public class CourseCardEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    //
    private Long id;
    //课程码
    private String code;
    //课程ID
    private Long goodsId;
    //创建人
    private Long createUserId;
    //所属人
    private Long userId;
    //价值
    private BigDecimal amount;
    //ENUM-状态:"NEW-未激活","ACTIVE-已激活","USED-已使用"
    private Integer status;
    //操作员ID
    private Long adminId;
    //使用时间
    private Date useTime;
    //起止时间
    Date[] useTimes;
    //自定义
    private String name;
    private String userName;

    public CourseCardEntity() {

    }

    //是否已经赠送
//    public Boolean getSend() {
//        return !createUserId.equals(userId);
//    }

    public CourseCardEntity(String code, Long goodsId, Long createUserId, Long userId, BigDecimal amount, Integer status) {
        this.code = code;
        this.goodsId = goodsId;
        this.createUserId = createUserId;
        this.userId = userId;
        this.amount = amount;
        this.status = status;
    }
}
